import request from '@/utils/request'

// 获取员工列表
export const getEmployeeList = params => request.get('/sys/user', { params })

// 导出员工excle
export const exportEmployee = () => request.get('/sys/user/export', { responseType: 'blob' })

// 下载导入员工模版
export const installEmployeeExcle = () => request.get('/sys/user/import/template', { responseType: 'blob' })

// 上传员工excle
export const upLoadEmployeeExcle = file => request.post('/sys/user/import', file)

// 删除员工
export const deleteEmployee = id => request.delete(`/sys/user/${id}`)

// 添加员工
export const postEmployee = data => request.post('/sys/user', data)

// 获取员工信息
export const getEmployeeDetail = id => request.get(`/sys/user/${id}`)

// 修改员工信息
export const putEmployeeDeatil = data => request.put(`/sys/user/${data.id}`, data)

// 获取已启用的角色列表
export const getEnableRoleList = () => request.get('/sys/role/list/enabled')

// 分配员工角色
export const putEmployeeRole = (roleIds, id) => request.put('/sys/user/assignRoles', {
  roleIds,
  id
})
